set the buttonNum of me to the spriteNum of me - (the firstSprite of me - 1)
setPrevChoice(me)
end
on setPrevChoice me
set myValue to getAt(getAt(the userdata of gReviewData, the questionNum of me), the buttonNum of me)
if myValue = 1 then
sendSprite(the spriteNum of me, #Toggle)
end if
end
on mouseDown me
set myValue to getAt(getAt(the userdata of gReviewData, the questionNum of me), the buttonNum of me)
case myValue of
0:
setAt(getAt(the userdata of gReviewData, the questionNum of me), the buttonNum of me, 1)
1:
setAt(getAt(the userdata of gReviewData, the questionNum of me), the buttonNum of me, 0)
end case
end
on getPropertyDescriptionList
set p_list to [#questionNum: [#comment: "Question number for this button:", #format: #integer, #range: [#min: 1, #max: 25], #default: 1], #firstSprite: [#comment: "First sprite of series:", #format: #integer, #range: [#min: 10, #max: 20], #default: 10]]
return p_list
end
on getBehaviorDescription
return "Each sprite will know its position in a group based on its sprite number." & RETURN & "It will also know what question it is applied to." & RETURN & "From these properties we can keep score in a global." & RETURN & "• Question number - choose from the range." & RETURN & "• First sprite - so the first sprite in the series gets a 1, etc." & RETURN & "NOTES:" & RETURN & "Uses global variable to keep track of button position, ON or OFF."